import java.util.*;

class RationalNumber {
    public int hashCode() {
        return numerator * 331 + denominator;
    }

    public static final RationalNumber ZERO = new RationalNumber(0, 1, true),
            NAN = new RationalNumber(1, 0, true);

    /**
     * 
     * @param numerator   分子
     * @param denominator 分母
     * @return 创建一个有理数
     */
    public static RationalNumber getInstance(int numerator, int denominator) {
        if (denominator == 0)
            return NAN;
        if (numerator == 0)
            return ZERO;
        if (denominator < 0)
            return new RationalNumber(-numerator, -denominator);
        return new RationalNumber(numerator, denominator);
    }

    /**
     * 分子
     */
    public final int numerator;
    /**
     * 分母
     */
    public final int denominator;

    /**
     * 创建一个有理数对象 允许抛出异常
     * 
     * @param numerator
     * @param denominator
     */

    private RationalNumber(int numerator, int denominator) {
        this(numerator, denominator, false);
    }

    /**
     * 创建一个有理数对象
     * 
     * @param numerator   分子
     * @param denominator 分母
     * @param suppress    创建对象时是否忽略异常
     */

    private RationalNumber(int numerator, int denominator, boolean suppress) {
        if (denominator <= 0 && numerator != 0 && !suppress) {
            throw new IllegalArgumentException("分母必须大于0");
        }
        if (suppress) {
            this.numerator = numerator;
            this.denominator = denominator;
            return;
        }
        int sign = numerator >= 0 ? 1 : (-1);
        int tempNumerator = sign * numerator;
        int tempDenominator = denominator;
        // ensure tempNumerator is bigger
        if (tempNumerator < tempDenominator) {
            int temp = tempNumerator;
            tempNumerator = tempDenominator;
            tempDenominator = temp;
        }
        while (true) {
            int difference = tempNumerator % tempDenominator;
            if (difference == 0) {
                this.numerator = numerator / tempDenominator * sign;
                this.denominator = denominator / tempDenominator;
                return;
            }
            tempNumerator = tempDenominator;
            tempDenominator = difference;
        }
        // throw new RuntimeException("Not implemented");
    }

}

class Slopes {
    public static class IntArrayRef {
        public final int[] self;
        public final int index;

        public IntArrayRef(int[] self, int index) {
            this.self = self;
            this.index = index;
        }

        public static IntArrayRef[] refs;
    }

    public final int[] self;
    public final Map<RationalNumber, Integer> slopes;

    public final Map<IntArrayRef, RationalNumber> slopeMap;

    public Slopes(int[] self) {
        this.self = self;
        this.slopes = new HashMap<>();
        this.slopeMap = new HashMap<>();
    }

    /**
     * 将两个点之间的斜率加入slopes中
     * 
     * @param anotherPoint 另一个点
     */

    public void count(int anotherPointIndex) {
        if (Solution.points == null)
            return;
        int[] anotherPoint = Solution.points[anotherPointIndex];
        RationalNumber slope = RationalNumber.getInstance(self[0] - anotherPoint[0], self[1] - anotherPoint[1]);
        if (slopes.containsKey(slope)) {
            slopes.put(slope, slopes.get(slope) + 1);
        } else {
            slopes.put(slope, 1);
        }
        slopeMap.put(IntArrayRef.refs[anotherPointIndex], slope);
    }

    /**
     * 找出最多的斜率
     * 
     * @return 最多的斜率
     */

    public int reportBest(RationalNumber[] slopeSlot) {
        int max = 0;
        for (RationalNumber slope : slopes.keySet()) {
            if (slopes.get(slope) < max)
                continue;
            max = slopes.get(slope);
            slopeSlot[0] = slope;

        }
        return max;
    }

    public static IntArrayRef[] buildIntArrayRefs(
            int[][] points) {
        IntArrayRef[] intArrayRefs = new IntArrayRef[points.length];
        for (int i = 0; i < points.length; i++) {
            intArrayRefs[i] = new IntArrayRef(points[i], i);
        }
        return IntArrayRef.refs = intArrayRefs;
    }
}

class Solution {
    public static int[][] points;

    public int[] bestLine(int[][] points) {
        Solution.points = points;
        Slopes.IntArrayRef[] intArrayRefs = Slopes.buildIntArrayRefs(points);
        List<Slopes> slopesList = new ArrayList<>();

        for (int i = 0; i < points.length; i++) {
            Slopes slopes = new Slopes(points[i]);
            for (int j = 0; j < points.length; j++) {
                if (i == j)
                    continue;
                if (points[i][0] == points[j][0] && points[i][1] == points[j][1])
                    continue;
                slopes.count(j);
            }
            slopesList.add(slopes);
        }

        RationalNumber[] maxSlope = new RationalNumber[1];
        Slopes maxSlopes = null;
        int maxPoints = 0;

        for (Slopes s : slopesList) {
            int count = s.reportBest(maxSlope);
            if (count > maxPoints) {
                maxPoints = count;
                maxSlopes = s;
            }
        }

        if (maxSlopes == null)
            throw new RuntimeException("No best slope");

        List<Integer> candidates = new ArrayList<>();
        RationalNumber best = maxSlope[0];

        for (int i = 0; i < points.length; i++) {
            int[] p = points[i];
            if (p == maxSlopes.self || best.equals(maxSlopes.slopeMap.get(p))) {
                candidates.add(i);
            }
        }

        Collections.sort(candidates);
        if (candidates.size() < 2)
            throw new IllegalArgumentException("No best line" + candidates);
        return new int[] { candidates.get(0), candidates.get(1) };
    }

    public static void main(String[] args) {
        int[][] input = { { -38935, 27124 }, { -39837, 19604 }, { -7086, 42194 }, { -11571, -23257 }, { 115, -23257 },
                { 20229, 5976 }, { 24653, -18488 }, { 11017, 21043 }, { -9353, 16550 }, { -47076, 15237 },
                { -36686, 42194 }, { -17704, 1104 }, { 31067, 7368 }, { -20882, 42194 }, { -19107, -10597 },
                { -14898, 24506 }, { -20801, 42194 }, { -52268, 40727 }, { -14042, 42194 }, { -23254, 42194 },
                { -30837, -53882 }, { 1402, 801 }, { -33961, -984 }, { -6411, 42194 }, { -12210, 22901 },
                { -8213, -19441 }, { -26939, 20810 }, { 30656, -23257 }, { -27195, 21649 }, { -33780, 2717 },
                { 23617, 27018 }, { 12266, 3608 } };
        int[] ret = new Solution().bestLine(input);
        System.out.println(Arrays.toString(ret));
    }

}